//
// Forward declare functions
//

/* Currently no functions to forward declare */



function mainAutomation()
{
    var page = null;
    var pageHandler = null;
    var pageRecognized = false;
 
    var currentLocation = document.location.href;
     
    debugLog('currentLocation=' + currentLocation);
    
    for (var index = 0; index < PAGES.length; index++)
    {
        if (PAGES[index].href.test(currentLocation))
        {
            page = PAGES[index];
            pageHandler = PAGES[index].handler;
            pageRecognized = true;
            break;
        }
    }

    if (pageRecognized)
    {
        pageHandler(page);
    }
    else
    {
        logError("ERROR - Unknown page:\n\n" + currentLocation);
    }
}

mainAutomation();
